package com.cloud.mall.sms.service;

import com.cloud.mall.api.CommonPage;
import com.cloud.mall.base.BaseResponse;
import com.cloud.mall.sms.dto.SmsFlashPromotionProduct;
import com.cloud.mall.sms.input.SmsFlashPromotionInpDTO;
import com.cloud.mall.sms.input.SmsFlashPromotionProductRelationInpDTO;
import com.cloud.mall.sms.out.SmsCouponHistoryOut;
import com.cloud.mall.sms.out.SmsFlashPromotionProductRelationOut;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "限时购和商品关系管理")
@RequestMapping("/flashProductRelation")
public interface SmsFlashPromotionProductRelationService {


    @ApiOperation("批量选择商品添加关联")
    @PostMapping("/create")
    BaseResponse create(@RequestBody List<SmsFlashPromotionProductRelationInpDTO> relationList);

    @ApiOperation("修改关联相关信息")
    @PostMapping("/update/{id}")
    BaseResponse update(@PathVariable Long id,
                        @RequestBody SmsFlashPromotionProductRelationInpDTO relation);

    @ApiOperation("删除关联")
    @PostMapping("/delete/{id}")
    BaseResponse delete(@PathVariable Long id);

    @ApiOperation("获取管理商品促销信息")
    @GetMapping("/{id}")
    BaseResponse<SmsFlashPromotionProductRelationOut> getItem(@PathVariable Long id);

    @ApiOperation("分页查询不同场次关联及商品信息")
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    @ResponseBody
    BaseResponse <CommonPage<SmsFlashPromotionProduct>> list(@RequestParam(value = "flashPromotionId") Long flashPromotionId,
                                                             @RequestParam(value = "flashPromotionSessionId") Long flashPromotionSessionId,
                                                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum);
}
